<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('advert/index')}">广告列表</a></li>
			<li><a href="{:url('advert/add')}">广告添加</a></li>
		</ul>
		<form class="well form-inline margin-top-20" method="post" action="{:url('advert/index')}">
			广告版本:
				<select class="form-control" name="a_type">
					<option value="0" <if condition="!$a_type" >selected </if>>请选择</option>
					<option value="10" <if condition="$a_type eq 10" >selected </if>>启动页</option>
					<option value="20" <if condition="$a_type eq 20" >selected </if>>其他页</option>
				</select>
            广告状态:
                <select class="form-control" name="a_status">
                    <option value="0" <if condition="!$a_status" >selected </if>>请选择</option>
                    <option value="10" <if condition="$a_status eq 10" >selected </if>>启用</option>
                    <option value="20" <if condition="$a_status eq 20" >selected </if>>停用</option>
                </select>
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:url('advert/index')}">清空</a>
		</form>
        <form class="js-ajax-form" action="" method="post">
        <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('advert/order')}">排序
            </button>
        </div>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
                    <th width="50">排序</th>
					<th width="50">ID</th>
					<th>版本号</th>
					<th>标题</th>
					<th>类型</th>
                    <th>查看图片</th>
                    <th>添加日期</th>
					<th width="90">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="advertising" item="vo">
				<tr>
                    <td><input name="a_sort[{$vo.id}]" class="input-order" type="text" value="{$vo.a_sort}"></td>
					<td>{$vo.id}</td>
					<td>{$vo.a_digital}</td>
					<td>{$vo.a_title}</td>
					<td>
						<if condition="$vo['a_type'] eq 10">
							启动页
							<elseif condition="$vo['a_type'] eq 20" />
							直播页
							<else />
						其他页
						</if>
					</td>
                    <td><a href="javascript:parent.imagePreviewDialog('{$vo.a_image}')";>
                        点击查看
                        </a></td>
                    <td>{$vo.a_createtime}</td>

					<td>
						<a href='{:url("advert/edit",array("id"=>$vo["id"]))}'>编辑</a> |
						<if condition="$vo['a_status'] eq 10">
							<a href="{:url('advert/enabled',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要停用此广告吗？">停用</a>
							<else />
							<a href="{:url('advert/enabled',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要启用此广告吗？"><b style="color: red">启用</b></a>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
        </form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>